from enum import Enum

from src.bean.statistic_column import StatisticColumn


class ColumnTypeEnum(Enum):
    str_col = ["id", "node", "source.ip", "destination.ip", "sip_geo_country_iso", "sip_geo_province_name",
               "sip_geo_city_name", "dip_geo_country_iso", "dip_geo_province_name", "dip_geo_city_name",
               "xffip_geo_country_iso", "xffip_geo_province_name", "xffip_geo_city_name",
               "req_payload_visible", "res_payload_visible", "dns.domain", "req_transfer_encoding",
               "res_transfer_encoding", "req_content_encoding", "res_content_encoding", "req_uri",
               "dangerous_deny_method", "dangerous_protocol", "dangerous_severity", "dangerous_threat_summary",
               "dangerous_traffic_type", "UserAgent_browser", "UserAgent_os", "UserAgent_device_type",
               "UserAgent_platform", "UserAgent_language", "UserAgent_browser_version", "UserAgent_os_version",
               "req_method"]
    number_col = [
                     "segmentCnt", "tcpflags.rst", "tcpflags.ack", "tcpflags.syn", "tcpflags.urg", "tcpflags.psh",
                     "tcpflags.syn-ack", "tcpflags.fin", "source.port", "source.packets", "source.bytes",
                     "destination.port", "destination.bytes", "destination.packets", "initRTT", "firstPacket",
                     "lastPacket", "ipProtocol", "protocolCnt",
                     "server.bytes", "totDataBytes", "network.packets", "network.bytes", "length", "client.bytes",
                     "http.uri_length_mean", "http.uri_length_var", "http.uri_param_count_mean",
                     "http.uri_param_count_var", "http.uri_depth_mean", "http.uri_depth_var",
                     "http.uri_filename_length_mean", "http.uri_filename_length_var", "http.bodyMagicCnt",
                     "http.statuscodeCnt", "http.clientVersionCnt", "http.response-content-typeCnt", "http.xffIpCnt",
                     "http.requestHeaderCnt", "http.serverVersionCnt", "http.responseHeaderCnt",
                     "http.useragentCnt", "http.uriCnt", "http.request-refererCnt", "http.hostCnt", "http.pathCnt",
                     "http.methodCnt", "http.method-GET", "http.method-POST", "dns.alpnCnt", "dns.ipCnt",
                     "dns.OpCodeCnt", "dns.PunyCnt", "dns.QueryClassCnt", "dns.QueryTypeCnt",
                     "dns.hostCnt", "dns.statusCnt", "tls.cipherCnt", "tls.ja3Cnt", "tls.ja3sCnt",
                     "tls.ja4Cnt", "tls.versionCnt", "tls.ja4_r", "tls.ja4_rCnt",
                     "status_code_1x_count", "status_code_2x_count", "status_code_3x_count", "status_code_4x_count",
                     "status_code_5x_count", "session_time_diff", "session_per_packet_req_time_mean",
                     "session_per_packet_res_time_mean", "per_packet_req_time", "per_packet_res_time",
                     "session_per_packet_time_mean",
                     "entropy_per_packet_req_body", "entropy_per_packet_res_body", "entropy_per_packet_all_body",
                     "entropy_session_req_body", "entropy_session_res_body", "entropy_session_all_body",
                     "entropy_per_packet_uri", "entropy_dns_domain", "network.bytes_minus_mean",
                     "network.bytes_z_score", "source.bytes_minus_mean", "source.bytes_z_score",
                     "destination.bytes_minus_mean", "destination.bytes_z_score", "totDataBytes_minus_mean",
                     "totDataBytes_z_score",
                     "http.requestHeaderCnt_minus_mean", "http.requestHeaderCnt_z_score",
                     "http.responseHeaderCnt_minus_mean",
                     "http.responseHeaderCnt_z_score", "source.packets_minus_mean", "source.packets_z_score",
                     "destination.packets_minus_mean", "destination.packets_z_score", "network.packets_minus_mean",
                     "network.packets_z_score", "URI_FEATURES_EXTRA_param_count", "URI_FEATURES_EXTRA_path_depth",
                     "URI_FEATURES_EXTRA_param_length_avg", "URI_FEATURES_EXTRA_param_length_max",
                     "UserAgent_special_char_count", "req_res_packet_len_rate", "res_req_packet_len_rate"
                 ] + StatisticColumn.columns.value
    v2_new_number_col = ['UserAgent_browser_version_0', 'UserAgent_browser_version_1', 'UserAgent_browser_version_2',
                         'UserAgent_browser_version_3']
    array_col = ["protocol", "http.uri", "http.response-content-type", "http.serverVersion",
                 "http.xffIp", "http.clientVersion", "http.statuscode", "http.bodyMagic", "http.request-content-type",
                 "http.useragent", "http.request-referer", "http.path", "http.host", "http.response-server",
                 "http.method",
                 "http.requestHeader", "http.responseHeader", "dns.ASN", "dns.RIR", "dns.GEO", "dns.alpn", "dns.ip",
                 "dns.OpCode", "dns.Puny", "dns.QueryClass", "dns.QueryType", "dns.status",
                 "dns.host", "tls.cipher", "tls.dstSessionId", "tls.ja3", "tls.ja3s", "tls.ja4",
                 "tls.srcSessionId", "tls.version", "packetPos",
                 "sql_injection_count", "cmd_injection_count", "xxe_attack_count", "xss_attack_count",
                 "sensitive_data_count", "deserialize_count", "log_injection_count"]
    v2_new_array_col = ["http.uri_domain", "http.uri_path", "http.uri_params"]
    bool_col = ["req_has_payload", "res_has_payload", "packet_no_res",
                "is_dangerous", "sql_injection_exist", "cmd_injection_exist", "xxe_attack_exist", "xss_attack_exist",
                "sensitive_data_exist", "deserialize_exist", "log_injection_exist",
                "URI_FEATURES_EXTRA_contains_sql", "URI_FEATURES_EXTRA_contains_xss", "URI_FEATURES_EXTRA_contains_cmd",
                "URI_FEATURES_EXTRA_contains_path",
                "URI_FEATURES_EXTRA_contains_redirect", "URI_FEATURES_EXTRA_contains_danger",
                "URI_FEATURES_EXTRA_contains_suspicious_ext", "UserAgent_is_attack", "UserAgent_is_enterprise",
                "UserAgent_is_bot", "UserAgent_is_unknown", "UserAgent_is_bot"]
